public class EnumMethod {
    public static void main(String[] args) {
        Season02 autumn = Season02.AUTUMN;
        System.out.println(autumn);
        System.out.println(autumn.name());//返回当前对象名，子类不能重写
        System.out.println(autumn.ordinal());//返回当前编号
        Season02[] values = Season02.values();//返回当前枚举类中所有对象
        for(Season02 value : values) {
            System.out.println(value);
        }

        Season02 x = Season02.valueOf("AUTUMN");//将字符串转化为枚举对象
        System.out.println("AUTUMN: "+x);

        System.out.println(x.compareTo(autumn));//比较两个枚举常量
        System.out.println(Season02.SPRING .compareTo(Season02.WINNER));
    }
}
//枚举类和普通类一样可以实现接口，但是不能继承类